#!/bin/bash
# Copyright 2014-2025 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0

# makedocinfologo - generate HTML docinfo file from an SVG image.
# Usage: makedocinfologo file.svg alt-text > docinfo-header.html
# Example: makedocinfologo ../images/vulkansc-unscaled.svg "Vulkan SC Logo" > vulkansc/docinfo-header.html

file=$1
if test ! -r "$file" ; then
    echo "Cannot read SVG file: $file" > /dev/stderr
    exit 1
fi
#echo "file: $file" > /dev/stderr
alt=${2-$file}
#echo "alt: $alt" > /dev/stderr

echo '<div style="text-align: center;">'
echo -n '    <span class="image"><img src="data:image/svg+xml;base64,'
base64 $1 | tr -d '\n'
echo '" alt="'$2'" width="50%">'
echo '    </span>'
echo '</div>'
